<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Google AJAX Search API 实例 - 基础</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
  </head>
  
  <body>
    <div id="content">正在加载...</div>
    <script src="http://www.google.cn/jsapi"></script>
    <script>
      google.load('search', '1'); // 加载 AJAX Search API 版本 1
      google.setOnLoadCallback(function() {
        // 创建一个 SearchControl 实例
        var searchControl = new google.search.SearchControl();
        
        // 依次添加几个搜索服务
        searchControl.addSearcher(new google.search.WebSearch());
        searchControl.addSearcher(new google.search.ImageSearch());
        searchControl.addSearcher(new google.search.LocalSearch());
        searchControl.addSearcher(new google.search.NewsSearch());
        searchControl.addSearcher(new google.search.VideoSearch());
        searchControl.addSearcher(new google.search.BookSearch());

        // 绘制界面元素
        searchControl.draw(document.getElementById("content"));

        // 执行初始搜索
        searchControl.execute("天安门");
      });
    </script>
  </body>
</html>